<template>
	<view class="global-shortbtn">
		<shortcut class="menu" v-if="showMenu" @act="getAction"></shortcut>
		<!-- <image class="btn" src="../../static/img/shortcut.png" mode="aspectFit"
			@tap="tapMenu"></image> -->
	</view>
</template>

<script>
	import shortcut from '../shortcut/shortcut.vue'
	export default {
		components:{
			shortcut
		},
		data() {
			return {
				showMenu: true,
			};
		},
		methods:{
			tapMenu(){
				this.showMenu = !this.showMenu;
			},
			getAction(msg){
				// if(msg=='hide') this.showMenu = false;
			}
		},
		watch:{
			// 监听路由变化
			$route(to,from){
				this.showMenu = false;
				// //console.log(to.path);
			}
		}
	}
</script>

<style lang="less" scoped>
	.global-shortbtn{
		position: fixed;
		left: 50%;bottom: 10upx;
		margin: 0 0 0 -17px;
		z-index: 999;
		.btn{
			width: 34px;height: 34px;
		}
	}
	.menu{
		position: fixed;
		width: 500upx;
		height: 600upx;
		background-color: #007AFF;
		left: 50%;bottom: 60px;
		margin: 0 0 0 -250upx;
	}
</style>
